local qingyu = fk.CreateSkill {
  name = "mini__qingyu",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["mini__qingyu"] = "清玉",
  [":mini__qingyu"] = "锁定技，当你受到伤害时，你需弃置两张牌并防止此伤害。",

  ["#mini__qingyu-invoke"] = "清玉：你需弃置两张牌，防止你受到的伤害",

  ["$mini__qingyu1"] = "如玉如珏，必不让须眉。",
  ["$mini__qingyu2"] = "大义赴死，女子当何不可！",
  ["$mini__qingyu3"] = "清玉无价，名节为大。",
}

qingyu:addEffect(fk.DetermineDamageInflicted, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(qingyu.name) and
      player:getHandcardNum() > 1
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local ids = table.filter(player:getCardIds("he"), function (id)
      return not player:prohibitDiscard(id)
    end)
    if #ids > 1 then
      room:askToDiscard(player, {
        min_num = 2,
        max_num = 2,
        include_equip = true,
        skill_name = qingyu.name,
        cancelable = false,
      })
      data.prevented = true
    end
  end,
})

return qingyu
